<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		
		<title></title>
	</head>
	<body>
		<div id="">
			<img src="img1/1.jpg" id="imgid" >
		</div>
		<button type="button" onclick="add(event)">开始</button>
	</body>
	<script type="text/javascript">
		var i=1;
		function add(event){
			var num=0;
			var temp=setInterval(function(){
				var imgobj=document.getElementById('imgid');
				var k=inter();
				var str='img1/'+k+'.jpg'
				imgobj.src=str;
				num++;
				if(num>29){
					clearInterval(temp);
				}
			},100)
		};
		function inter(){
			i++;
			if(i>9){
				i=1;
			}
			return i;
		}
	</script>
</html>
